package com.gavin.ioc.controller;

import com.gavin.ioc.model.DbTypes;
import com.gavin.ioc.model.Person;
import jakarta.annotation.PostConstruct;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller
public class YmlController {
    @Value("${my.key3}")
    private String myKey3;

    @Value("${my.key4}")
    private  Integer myKey4;

    @Autowired
    private Person person;

    @Value("${person.id}")
    private Integer id;

    @Autowired
    private DbTypes dbTypes;
    @PostConstruct
    public void init(){
        System.out.println("mykey3:"+myKey3);
        System.out.println("mykey4:"+myKey4);
        System.out.println("person:"+person);
        System.out.println("id:"+id);
        System.out.println("Dbtpyes:"+dbTypes);
    }
}
